package jasonllinux.app.life;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class Activity03 extends Activity {
	
	private Button button;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		System.out.println("Acitvity03------------->onCreate");
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity03);
		button = (Button) findViewById(R.id.button3);
		button.setOnClickListener(new MyButtonListener1());
		
	}
	
	class MyButtonListener1 implements OnClickListener{
		//Intent在不同应用程序之间传递
		@Override
		public void onClick(View v) {
			Uri uri = Uri.parse("smsto://15850775699");
			Intent intent = new Intent(Intent.ACTION_SENDTO,uri);
			intent.putExtra("sms_body", "The text body we defined");
			Activity03.this.startActivity(intent);
			
		}
		
	}

	@Override
	protected void onDestroy() {
    	System.out.println("Acitvity03------------->onDestroy");
		super.onDestroy();
	}

	@Override
	protected void onPause() {
		System.out.println("Acitvity03------------->onPause");
		super.onPause();
	}

	@Override
	protected void onRestart() {
		System.out.println("Acitvity03------------->onRestart");
		super.onRestart();
	}

	@Override
	protected void onResume() {
		System.out.println("Acitvity03------------->onResume");
		super.onResume();
	}

	@Override
	protected void onStart() {
		System.out.println("Acitvity03------------->onStart");
		super.onStart();
	}

	@Override
	protected void onStop() {
		System.out.println("Acitvity03------------->onStop");
		super.onStop();
	}
	
	
}
